This invention relates to a sewing machine control apparatus which controls the speed of rotation of a sewing machine to a predetermined value.
FIGS. 8 through 11 are diagrams for a description of one example of a conventional sewing machine which has been disclosed for instance by Published Unexamined Japanese Patent Application (OPI) No's 257686/1983 or 257689/1983 FIG. 8 shows the sewing machine. In FIG. 8, reference numeral 1 designates a sewing machine body which is coupled to an electric motor 2 through a sewing machine body's pulley 3, an endless belt 4 and a motor's pulley 5; 6, a control device; 7, a pedal with which the operator applies instructions such as for instance a speed instruction to the control device 6; 8, a needle position detector for detecting the position of the needle connected to the sewing machine body; and 9, an encoder built in the motor 2, for detecting the speed of rotation of the motor shaft.
FIG. 9 is a block diagram showing the arrangement of the control system shown in FIG. 8. In FIG. 9, reference numeral 1, designates the aforementioned sewing machine body; 2, the electric motor; 4, the endless belt; 8, the needle position detector; 9, the encoder; 10, a speed (number-of-revolution) setting unit which, when the pedal 7 is depressed a predetermined distance or more, outputs a start instruction signal S.sub.D and a speed instruction signal P.sub.S corresponding to the amount of depression of the pedal 7; 11, a multiplier; 12, a speed control circuit; 13, a counter for counting the output signal P.sub.E of the encoder 9; 14, a latch circuit; and 15, an arithmetic circuit.
FIG. 10 is a block diagram showing the arithmetic circuit 15 in detail. In FIG. 10, reference numeral 16 designates a central processing circuit (hereinafter referred to as "a CPU 16", when applicable). The CPU 16, in synchronization with a clock signal from an oscillator circuit 17, receives data through an input port 18, applies data to an output port 19, makes access to a RAM 20, and reads data from a ROM 21.
Further in FIG. 10, reference numeral 22 designates a reset circuit. When a voltage for operating the arithmetic circuit 15 is stabilized after the power switch is turned on, the output of the reset circuit 22 is raised to "H" level from "L" level to allow the CPU 16 to start its operation.
FIG. 11 is a flow chart for a description of the rotation transfer ratio operation of the arithmetic circuit 15. In Steps 23, 24 and 25, initial setting operations are carried out. In Step 26, it is determined whether or not the rotation transfer ratio operation is accomplished. In Step 27, the start instruction signal S.sub.D is inputted. In Step 28, it is determined whether the start instruction signal S.sub.D is at "H" level. In step 29, an interrupt is disabled when a needle position detection signal N.sub.D (the part (b) of FIG. 11) is detected. In step 30, the interrupt is enabled. In Step 31, it is determined whether or not the rotation transfer ratio operation is accomplished. In Step 32, it is determined whether or not the rotation transfer ratio operation should be performed. In Step 33, the rotation transfer ratio operation is permitted. In Steps 34 through 38, the rotation transfer ratio operation is carried out.
The operation of the sewing machine control device thus constructed will be described.
When the pedal 7 is depressed the predetermined distance or more, the speed setting unit 10 outputs the start instruction signal S.sub.D, which is applied to the speed control circuit 12 (FIG. 9). As a result, the speed control circuit 12 starts the electric motor 2, and simultaneously the latter 2 starts the sewing machine body 1 being coupled through the endless belt thereto. On the other hand, speed setting unit 10 provides a speed instruction signal P.sub.S in correspondence to the amount of depression of the pedal 7 which is applied to the multiplier 11. In the latter 11, the speed instruction signal is multiplied by the set value Dhd P provided by the arithmetic circuit 15, to provide a rotation setting instruction P.sub.M, which is applied to the speed control circuit 12. The latter 12 performs a control operation so that the speed of the motor 2 which is obtained from the output signal P.sub.E of the encoder be equal to the speed instruction signal P.sub.M. Thus, the motor 2 is so controlled that its speed is equal to the speed indicated by the speed setting instruction P.sub.M.
When the pedal 7 is returned to the original position (hereinafter referred to as "a neutral position", when applicable), the speed setting unit 10 eliminates the start instruction signal S.sub.D. The speed control circuit 12 sets a speed low enough to position the needle according to the speed instruction signal P.sub.S, measures the output signal P.sub.E of the encoder 9 to detect the speed of the motor 1, and stops the motor 2 when, after the actual speed reaches the set speed or lower, the needle position signal N.sub.D is outputted. Thus, the sewing machine body 1 is stopped with the needle held at the predetermined position.
The counter 13 is reset when a needle position edge pulse signal N.sub.DP detecting the rise or fall of the needle position signal N.sub.D is set to "L" level from "H", and starts counting the output signal P.sub.E of the encoder 9. The latch circuit 14 latches the output data D.sub.C of the counter 13 when the needle position edge pulse signal N.sub.DP is set to "L" level from "H" level similarly as in the above-described case, and applies it to the arithmetic circuit 15.
In FIG. 11, under the initial condition revealed immediately after the reset signal is raised to "H" level from "L" level, a set value D.sub.P1 is set. When, with the pedal 7 depressed, the start instruction signal S.sub.D is raised to "H" level from "L" level, an interrupt is enabled, and at the second switching of the needle position signal N.sub.D from "H" level to "L" level; that is, when the sewing machine body 1 has made one revolution, the output data D.sub.E of the latch circuit is obtained which is the total pulse number of the output signal P.sub.E of the encoder 9 indicating the angle of rotation of the motor 2 during one rotation of the sewing machine body 1. Thus, a transfer rotation ratio D.sub.P is obtained according to the following equation (1): EQU D.sub.P =D.sub.E /R (1)
where R is the pulse number of the output signal P.sub.E of the encoder 9 provided while the motor 2 makes one revolution.
That is, D.sub.P in equation (1) is the ratio of the angle of rotation of the motor shaft to the sewing machine spindle; that is, the ratio of the motor pulley diameter to the sewing machine body pulley diameter (hereinafter referred to as "a transfer rotation ratio", when applicable).
If the speed instruction value for the motor is represented by N.sub.MT, then the following equation (2) is established: EQU N.sub.MT =N.sub.SM .times.D.sub.P ( 2)
where N.sub.SM is the speed instruction value for the sewing machine body.
In equation (2), the speed instruction value N.sub.MT corresponds to the speed setting instruction P.sub.M in FIG. 9, and accordingly the speed instruction signal P.sub.S is the speed instruction value for the sewing machine body.
The flow chart of FIG. 11 will be described. When the power switch is turned on, in Steps 23, 24 and 25, the initial setting operations are carried out. Next, in step 27, the start instruction signal S.sub.D is received through the input port. In Step 28, it is determined whether the start instruction signal thus received is at "H" level or it is at "L" level. If it is at "L" level, in Step 29 the interrupt shown in the part (b) of FIG. 11 is disabled, and Step 26 is effected again. If in step 28, the start instruction signal S.sub.D is at "H" level, the interrupt (the part (b) of FIG. 11) is enabled, and Step 26 is effected again.
In Step 26, it is determined from a flag END whether or not the rotation transfer ratio operation has been accomplished. If it is accomplished, the following operation is carried out. If not accomplished, Step 27 is effected. When the rotation transfer ratio operation has been accomplished, the flag End is set in Step 35; and when it has not been accomplished, the flag end is maintained reset in step 23.
Now, the interrupt shown in the part (b) of FIG. 11 will be described. The interrupt is carried out when the needle position detection signal N.sub.D is detected. In Step 31, it is determined from the flag END whether or not the rotation transfer ratio operation has been accomplished. When it is determined that the rotation transfer ratio operation has been accomplished, no interrupt is carried out. If not, Step 32 is effected, so that it is determined from the flag FAST whether or not the rotation transfer ratio operation should be performed. The flag FAST is set in Step 33 at the first interrupt shown in the part (b) of FIG. 11. Hence, the rotation transfer ratio operation is performed when the needle position detection signal N.sub.d is detected twice.
In Steps 34, 35, and so on, the rotation transfer ratio operation is carried out. In Step 34, the total pulse number D.sub.E of the output signal P.sub.E of the encoder 9 is inputted through the input port. In Step 35, the flag END is set, and in Step 36, a rotation transfer ratio D.sub.2 is operated. In Step 37, the rotation transfer ratio D.sub.P2 is stored in a part of the RAM 20 such as a RAM1, and in Step 38 the rotation transfer ratio D.sub.P2 is outputted. Thus, the interrupt has been accomplished.
In the above-described prior art, one needle position signal N.sub.D is produced every revolution. However, it should be noted that the above-described Published Unexamined Japanese Patent Application No. 257686/1986 has revealed that the rotation transfer ratio can be obtained by producing a plurality of needle position signals N.sub.D every rotation; that is, by producing them at equal angular intervals.
When the output signal of the encoder 9 is not detected for instance because of the breaking of wire, D.sub.P in equation (1) is zero, and the rotation transfer ratio operation is performed. Therefore, the sewing machine is operated with an incorrect rotation transfer ratio.
When an error occurs with the rotation transfer ratio operation as was described above, there has been provided no means of securing the operator nor means for informing the operator of the fact that the rotation transfer ratio operation is erroneous. Furthermore, in the prior art, the rotation transfer ratio operation is performed immediately after the needle position signal N.sub.D is received with the sewing machine body started. FIG. 12 is a graphical representation indicating the variation in the number of revolutions per minute (rpm) of the motor 2 being accelerated. At the start (F in FIG. 12) of the motor 2, slip is liable to occur with the sewing machine body pulley 3, the endless belt 4, and the motor pulley 5. Therefore, where, as shown in FIG. 13, the needle position signal N.sub.D is detected immediately after the start instruction signal S.sub.D is raised to "H" level from "L" level (or the distance G is short), the rotation transfer ratio operation is erroneous, being performed when the slip occurs in the above-described manner.